package com.mongo.data.enums;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

public enum NodeType {

    UPLOAD_NODE("uploadNode"),
    DATA_NODE("dataNodes"),
    BUSINESS_NODE("businessNodes");

    private static Map<String, NodeType> nodeTypeMap = new HashMap<>();

    static {
        for (NodeType bagType : NodeType.values()) {
            nodeTypeMap.put(bagType.name, bagType);
        }
    }

    @Getter
    private String name;

    NodeType(String name) {
        this.name = name;
    }

    public static NodeType toEnum(String name) {
        return nodeTypeMap.get(name);
    }




}
